<template>
  <span>
      {{ '数据: '+JSON.stringify(value) }}
  </span>
  <br/>
  <span>
      {{ '类型: ' + JSON.stringify(actualAnChartField.type) }}
  </span>
</template>
<script setup lang="ts">
import {onMounted, ref} from 'vue';
import {IAnChartField} from "@/api/sys/model/entitysModel";

const props = defineProps({
  valueFetch: {
    type: Function,
    default: () => {
      return '';
    },
  },
  anChartField: {
    type: Object,
  },
});

const actualAnChartField:IAnChartField = props.anChartField as IAnChartField;

const value = ref('');
function init(){
  props.valueFetch().then(
    res => {
      value.value = res.value;
    }
  );
}
onMounted(() => {
  init();
});

onUpdated(() => {
  init();
});
</script>
